package com.example.tests;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.io.IOException;

import org.testng.annotations.Test;

import utils.SortedListOf;

import com.example.fw.Contact;

public class TestContactDeletion extends TestBase
{

	@Test
	public void shouldDeleteFirstContact() throws IOException
	{
		SortedListOf<Contact> oldList = app.getContactHelper().getContacts();

		Contact contact = new Contact();

		contact = app.getContactHelper().getFirstContact();

		app.getContactHelper().deleteFirstContact();

		SortedListOf<Contact> newList = app.getContactHelper().getContacts();

		assertThat(newList, equalTo(oldList.without(contact)));

	}
}
